<!DOCTYPE html>
<html>
	<head>
		<title>个人中心-信息绑定</title>
		<meta name="description" content="个人中心-信息绑定"/>
        <meta name="keywords" content="个人中心-信息绑定"/>
        <meta charset="utf-8">
        <meta name="robots" content="all" />
        <meta name="author" content="biaofan.com.cn" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
		<link href="css/am.css" rel="stylesheet"/>
		<link href="css/iconfont.css" rel="stylesheet"/>
		<link href="css/style.css" rel="stylesheet"/>
        <link rel="stylesheet" href="css/flexslider.css">
		<script src="js/jquery.js"></script>
        <script src="js/jquery.flexslider.js"></script>
	</head>
	<body>
    
    <div class="webpage">
        <div class="page-userBinding">
            <div class="top">
                <img src="http://logo.biaofun.com/biaofuna.svg" alt="BIAOFUN·标梵互动" title="BIAOFUN·标梵互动">
                <p>企业互联网营销解决方案专家</p>
            </div>
            <div class="_form">
                <form action="">
                    <div class="input-item">
                        <input class="am i-phone" type="text" name="" placeholder="请输入您的手机号">
                        <i class="iconfont icon-phone am"></i>
                    </div>
                    <div class="input-item">
                        <input class="am" type="text" name="" placeholder="请输入验证码">
                        <input class="getcode grad" id="btnSendCode" type="button" value="获取验证码" onClick="sendMessage()" />
                    </div>
                    <button class="grad">确认绑定</button>
                    <p>*标梵互动将严格保护您的隐私信息</p>
                    <a class="goprevious" href="javascript:history.go(-1)">返回上一级</a>
                </form>
            </div>
        </div>
       
    </div>

    <script src="js/base.js"></script>
    <script src="js/wow.min.js"></script>
    <script type="text/javascript">
        var InterValObj; //timer变量，控制时间
        var count = 70; //间隔函数，1秒执行
        var curCount;//当前剩余秒数
        var code = ""; //验证码
        var codeLength = 4;//验证码长度
        function sendMessage() {
        curCount = count;
        var dealType; //验证方式
        var uid=$("#uid").val();//用户uid
        if ($("#phone").attr("checked") == true) {
            dealType = "phone";
        }
        else {
            dealType = "email";
        }
        //产生验证码
        for (var i = 0; i < codeLength; i++) {
            code += parseInt(Math.random() * 9).toString();
        }
        //设置button效果，开始计时
            $("#btnSendCode").attr("disabled", "true");
            $("#btnSendCode").val( + curCount + "秒再获取");
            InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次
        //向后台发送处理数据
            $.ajax({
                type: "POST", //用POST方式传输
                dataType: "text", //数据格式:JSON
                url: '/', //目标地址
                data: "dealType=" + dealType +"&uid=" + uid + "&code=" + code,
                error: function (XMLHttpRequest, textStatus, errorThrown) { },
                success: function (msg){ }
            });
        }
        //timer处理函数
        function SetRemainTime() {
            if (curCount == 0) {                
                window.clearInterval(InterValObj);//停止计时器
                $("#btnSendCode").removeAttr("disabled");//启用按钮
                $("#btnSendCode").val("重新发送验证码");
                code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效    
            }
            else {
                curCount--;
                $("#btnSendCode").val( + curCount + "秒再获取");
            }
        }
        </script>

        <script>
             ////输入框获得焦点时
            $(".input-item input").focus(function(event) {
                $(this).siblings("i").css('color','#d8093a');
            });
            
            ////输入框失去焦点时
            $(".input-item input").blur(function(event) {
                $(this).siblings("i").css('color','#666');
            });
        </script>
	</body>
</html>
